import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Booking from '@/components/Order/Booking'
import BookingDateSelect from '@/components/Order/BookingDateSelect'

import Layout from '@/components/Common/Layout'
import One from '@/components/One'
import Two from '@/components/Two'
import Three from '@/components/Three'


import Count_One from '@/components/Count_One'
import Count_Two from '@/components/Count_Two'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '',
      component: Layout,
      children: [{
        path: '/One',
        name: 'One',
        component: One
      },
      {
        path: '/Two',
        name: 'Two',
        component: Two
      }, {
        path: '/Three',
        name: 'Three',
        component: Three
      }]
    },
    {
      path: '/HelloWorld/:id',
      name: 'HelloWorld',
      component: HelloWorld,
      props: function (route) {
        return { query: route.query.q }
      }
    },
    {
      path: '/Order/Booking',
      name: 'booking',
      component: Booking,
      meta: {
        keepAlive: false  //默认要缓存
      }
    },
    {
      path: '/Order/BookingDateSelect',
      name: 'BookingDateSelect',
      component: BookingDateSelect,
      meta: {
        keepAlive: false  //默认要缓存
    }
    },
    {
      path: '/Count_One',
      name: 'Count_One',
      component: Count_One
    },
    {
      path: '/Count_Two',
      name: 'Count_Two',
      component: Count_Two
    }
  ]
})
